package com.example.springboot.service.impl;

import com.example.springboot.mapper.DepartmentMapper;
import com.example.springboot.pojo.Department;
import com.example.springboot.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentServiceImpl implements DepartmentService {

    @Autowired
    private DepartmentMapper departmentMapper;

    @Override
    public Department findDepartment(String department) {
        return departmentMapper.findDepartment(department);
    }

    @Override
    public List<Department> getAllDepartment() {
        return departmentMapper.getAllDepartment();
    }

    @Override
    public void addDepartment(String department) {
        departmentMapper.addDepartment(department);
    }

    @Override
    public void deleteDepartment(Integer id) {
        departmentMapper.deleteDepartment(id);
    }

    @Override
    public void updateDepartment(Integer id, String department) {
        departmentMapper.updateDepartment(id,department);
    }
}
